Pod::Spec.new do |s|
  s.name         = 'AXSDK'
  s.version      = '1.0.15'
  s.license      = 'MIT'
  s.homepage     = 'https://gitee.com/andyxuan'
  s.authors      = { "AndyXuan" => "xuanpeng@htyg.com.cn" }
  s.summary      = 'Internal SDK'

  s.platform     =  :ios, '9.0'
#  s.source       =  { :path => '.' }
  s.source       =  { :git => 'https://gitee.com/kaoyanvip/IOS-SDK.git', :tag => s.version }
  s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' }
  s.source_files = "AXSDK", "AXSDK/*.{h,m,swift}"
#s.frameworks   =  ''
  s.requires_arc = true
  s.resource = "AXSDK/**/*.{bundle}"
  # s.preserve_paths = "AXSDK/module.modulemap"
  # s.module_map = "AXSDK/module.modulemap"
  # s.pod_target_xcconfig = { 'HEADER_SEARCH_PATHS' => '$(PODS_ROOT)/AXSDK' }
  # s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(PODS_ROOT)/AXSDK' }


  s.subspec 'Common' do |c|
    c.source_files = "AXSDK/Common/*.{h,m,swift}"
  end

  s.subspec 'Dao' do |dao|
    dao.subspec 'BaseTable' do |bt|
        bt.source_files = "AXSDK/Dao/BaseTable/**/*.{h,m,swift}"
    end

    dao.subspec 'Engine' do |en|
        en.source_files = "AXSDK/Dao/Engine/**/*.{h,m,swift}"
        en.dependency 'AXSDK/Dao/BaseTable'
        en.dependency 'AXSDK/Dao/Error'
    end

    dao.subspec 'Error' do |err|
        err.source_files = "AXSDK/Dao/Error/**/*.{h,m,swift}"
    end

    dao.dependency 'AXSDK/Common'
    dao.dependency 'AXSDK/Tool'
    dao.dependency 'SQLite.swift'
    dao.dependency "SQLiteMigrationManager.swift"
  end

  s.subspec 'Delegate' do |delegate|
    delegate.source_files = "AXSDK/Delegate/**/*.{h,m,swift}"
  end

  s.subspec 'Model' do |model|
    model.source_files = "AXSDK/Model/**/*.{h,m,swift}"
  end

  s.subspec 'Vender' do |vender|
    vender.subspec 'EZSwiftExtensions' do |ez|
      ez.source_files = "AXSDK/Vender/EZSwiftExtensions/**/*.{h,m,swift}"
    end

    vender.subspec 'SwiftValidator' do |sv|
      sv.source_files = "AXSDK/Vender/SwiftValidator/**/*.{h,m,swift}"
    end
  end

  s.subspec 'Tool' do |tool|
    tool.subspec 'Util' do |util|
      util.source_files = "AXSDK/Tool/*.{h,m,swift}"
    end
    tool.subspec 'KVC' do |kvc|
       kvc.source_files = "AXSDK/Tool/KVC/*.{h,m,swift}"
    end

    tool.subspec 'KVO' do |kvo|
       kvo.source_files = "AXSDK/Tool/KVO/*.{h,m,swift}"
    end

    tool.subspec 'Operator' do |operator|
      operator.source_files = "AXSDK/Tool/Operator/*.{h,m,swift}"
      operator.dependency 'AXSDK/Tool/Category'
    end

    tool.subspec 'RichText' do |richt|
      richt.source_files = "AXSDK/Tool/RichText/*.{h,m,swift}"

      richt.dependency 'BonMot'
    end

    tool.subspec 'Swizzling' do |swizzling|
      swizzling.source_files = "AXSDK/Tool/Swizzling/*.{h,m,swift}"

      swizzling.dependency 'Aspects'
    end

    tool.subspec 'Transform' do |transform|
      transform.source_files = "AXSDK/Tool/Transform/*.{h,m,swift}"
    end

    tool.subspec 'Validator' do |validator|
      validator.source_files = "AXSDK/Tool/Validator/*.{h,m,swift}"
    end

    tool.subspec 'Category' do |category|
      category.source_files = "AXSDK/Tool/Category/**/*.{h,m,swift}"
      category.dependency 'AXSDK/Vender/EZSwiftExtensions'
      category.dependency 'AXSDK/Tool/Util'
    end
    tool.dependency 'CocoaLumberjack/Swift'

    tool.dependency 'DeviceKit'
    tool.dependency 'ObjectMapper'
    tool.dependency 'AXSDK/Vender/SwiftValidator'
    tool.dependency 'KeychainAccess'
    tool.dependency 'SwiftyJSON'
  end

  s.subspec 'ViewController' do |vc|
    vc.source_files = "AXSDK/ViewController/**/*.{h,m,swift}"

    vc.dependency 'AXSDK/Common'
    vc.dependency 'AXSDK/Tool'
  end

  s.subspec 'View' do |view|
    view.source_files = "AXSDK/View/**/*.{h,m,swift}"

    view.dependency 'AXSDK/Common'
    view.dependency 'AXSDK/Tool'
    view.dependency 'AXSDK/ViewController'
    view.dependency 'CRToast'
    view.dependency 'MBProgressHUD'
  end

  s.subspec 'Service' do |service|
    service.source_files = "AXSDK/Service/**/*.{h,m,swift}"

    service.dependency 'AXSDK/Common'
    service.dependency 'AXSDK/Tool'
    service.dependency 'AXSDK/View'
    service.dependency 'Moya'
  end

  s.subspec 'Router' do |router|
    router.source_files = "AXSDK/Router/**/*.{h,m,swift,py}"

    router.dependency 'AXSDK/Common'
    router.dependency 'AXSDK/Tool'
  end

  s.dependency 'SnapKit'
  s.dependency 'SwiftyTimer' 


  s.dependency "AwesomeCache"
  s.dependency 'DateToolsSwift'
  s.dependency 'Kingfisher'
  s.dependency 'CryptoSwift'
  s.dependency 'Swiftz'
  s.dependency 'Curry'
  s.dependency 'MJRefresh'
  s.dependency 'SwiftyUserDefaults'
  s.dependency "AsyncSwift"
  s.dependency 'RandomKit'
  s.dependency 'KMNavigationBarTransition'
end
